package com.zg.scf.enm;

import com.zg.common.core.enm.BaseEnumerator;

/**
 * DESCRIPTION
 *
 * @author zhanfeng.liang
 * @since 2025-07-15
 */

public enum StateEnum implements BaseEnumerator {

    Y ("1", "正常"),
    N ("0", "停止");

    private final String value;
    private final String label;

    StateEnum(String value, String label) {
        this.value = value;
        this.label = label;
    }

    @Override
    public String getLabel() {
        return label;
    }

    @Override
    public String getValue() {
        return value;
    }

    public static String getByValue(String value) {
        for (StateEnum type : StateEnum.values()) {
            if (type.getValue().equals(value)) {
                return type.getLabel();
            }
        }
        return "";
    }
}
